﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Mechanics.Transactions {
    import Classes.*;
    import Transactions.*;

    public class TMechanicDataTransfer extends TFarmTransaction {

        protected var m_ownerObject:MechanicMapResource;
        protected var m_params:Array;

        public function TMechanicDataTransfer(_arg1:MechanicMapResource){
            this.m_ownerObject = _arg1;
            this.m_params = new Array();
            super();
        }
        public function get params():Array{
            return (this.m_params);
        }
        public function getOwner():MechanicMapResource{
            return (this.m_ownerObject);
        }
        public function addDataTransfer(_arg1:String, _arg2:String, _arg3, _arg4):void{
            if (!this.pruneParams(_arg1, _arg2, _arg3, _arg4)){
                this.m_params.push({
                    source:_arg1,
                    dest:_arg2,
                    target:_arg3,
                    extraParams:_arg4
                });
            };
        }
        private function pruneParams(_arg1:String, _arg2:String, _arg3, _arg4):Boolean{
            var _local6:String;
            var _local7:Object;
            var _local5:Boolean;
            for (_local6 in this.m_params) {
                _local7 = this.m_params[_local6];
                if ((((((((_arg3 == _local7.target)) && ((_arg4 == _local7.extraParams)))) && ((_arg2 == _local7.source)))) && ((_arg1 == _local7.dest)))){
                    this.m_params.splice(_local6, 1);
                    _local5 = true;
                };
            };
            return (_local5);
        }
        override public function perform():void{
            signedCall("GameMechanicService.mechanicDataTransfer", this.m_ownerObject.getId(), this.m_params);
        }

    }
}//package Mechanics.Transactions 
